<?php
/**
 # com_jvframwork - JV Framework
 # @version		1.5.x
 # ------------------------------------------------------------------------
 # author    Open Source Code Solutions Co
 # copyright Copyright (C) 2011 joomlavi.com. All Rights Reserved.
 # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL or later.
 # Websites: http://www.joomlavi.com
 # Technical Support:  http://www.joomlavi.com/my-tickets.html
-------------------------------------------------------------------------*/
// no direct access
defined('_JEXEC') or die('Restricted access');

if(file_exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_jvframework'.DS.'libraries'.DS.'framework.php')){
    include_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_jvframework'.DS.'libraries'.DS.'framework.php');
    $jv     = JVFactory::getFramework($this); $jv->initialise();    
    $parser = JVFactory::getLayoutParser(JVLayout::getInstance(), JVFactory::getParameter());
    
    $ajax = JRequest::getVar('ajax');    
    $print = JRequest::getVar('print');  
    $email = JRequest::getVar('link'); 
    
    if($print != ''){
        $class = ' class="print-page"';
    }elseif($email){
        $class = ' class="email-page"';
    }else{
        $class = '';
    }
    
    if(!$ajax){
        $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $jv->get('Language') . '" lang="' . $jv->get('Language') . '" >';
        $html .= '<head>';
        $html .= $parser->loadModule(array('name'=>'head'));
        $html .= '</head><body'.$class.'>';
        $html .= $parser->loadModule(array('name'=>'component'));    
        echo $html.'</html></body>'   ; 
    }else{
        echo $parser->loadModule(array('name'=>'component'));    
    }
    
}else{
    JError::raiseError('JV Framework not found','Please install JV Framework to use this template.<br/>Go to <a href="http://joomlavi.com">http://joomlavi.com</a> or contact <a href="mailto:info@joomlavi.com">info@joomlavi.com</a> for infomation about JV Framework');
}
